//
//  WeatherViewController.m
//  DLTravels
//
//  Created by mac1012 on 2016/12/13.
//  Copyright © 2016年 DianlE. All rights reserved.
//

#import "WeatherViewController.h"
#import "WeatherForecastHeadView.h"
#import "WeatherForecastCell.h"
#import "WeatherLineView.h"

@interface WeatherViewController ()<UITableViewDelegate,UITableViewDataSource>{
 
    UITableView *_tableView;
    
}

@end

@implementation WeatherViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    [_tableView registerClass:[WeatherForecastCell class] forCellReuseIdentifier:KCellIdentifier_WeatherForecastCell];
    
    _tableView.userInteractionEnabled = NO;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.tableHeaderView = [self customHeadView];
    _tableView.tableFooterView = [self customFootView];
    
    [_tableView setBackgroundColor:[UIColor colorWithHexString:@"2CC7F7"]];
    [self.view addSubview:_tableView];
    
}


- (UIView *)customHeadView{
    
    WeatherForecastHeadView *headView = [[WeatherForecastHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, 180)];
    
    return headView;
}


- (UIView *)customFootView{
    
    WeatherLineView *lineView = [[WeatherLineView alloc] init];
    
    
    return lineView;
}

#pragma mark --UITableView



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 200;
}





- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 1;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    WeatherForecastCell *cell = [tableView dequeueReusableCellWithIdentifier:KCellIdentifier_WeatherForecastCell ];
    
    cell.positionLabel.text = @"广州";
    cell.temperatureLabel.text = @"20°";
    
    return cell;
}

@end
